package conson.tech.manage.scene.vo;

import conson.tech.core.util.DateUtils;
import conson.tech.manage.scene.entity.Dictionary;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @Description: 字典展示
 * @author: yuwenshuo
 * @since: 2020-06-22 09:51
 */

@Data
@NoArgsConstructor
public class DictionaryVO implements Serializable {

    @ApiModelProperty(value = "字典id")
    private Integer id;

    @ApiModelProperty(value = "字典值")
    private String val;

    @ApiModelProperty(value = "字典描述")
    private String remark;

    @ApiModelProperty(value = "创建人")
    private String createdBy;

    @ApiModelProperty(value = "创建时间")
    private Long createdTime;

    @ApiModelProperty(value = "状态值 0-生效 1-冻结")
    private Integer state;


    public DictionaryVO(Dictionary dictionary){
        this.id = dictionary.getId();
        this.val = dictionary.getVal();
        this.remark = dictionary.getRemark();
        this.createdBy = dictionary.getCreatedBy();
        this.createdTime = DateUtils.getMilliByTime(dictionary.getCreatedTime());
        this.state = dictionary.getState();
    }


    private static final long serialVersionUID = 1L;

}
